UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nTUqlO166Vvm9FINuRqmTJVDMdCoOrecneFbZvjjbxY='
WHERE
key_id = 'c2bbbfe6681411d752949794222974af9aad836e38349899ed3ee85b1215585b'
AND (
token = 'nTUqlO166Vvm9FINuRqmTJVDMdCoOrecneFbZvjjbxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)