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