UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3GttmeWiDvNgeon2NF96sY0F2zylznIf+y6ETyNXYPI='
WHERE
key_id = '774c6388c0011047195400ea2df04f3802027da786695447cb3bc89a22311f3b'
AND (
token = '3GttmeWiDvNgeon2NF96sY0F2zylznIf+y6ETyNXYPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)