UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jqc1zEj+jJJN19upGPgNKtcPzSiI8y707LABm/lVyHY='
WHERE
key_id = '56e116bb7f8bed0bb300751ec17bd0afeb476574eb55d2250fa9ecbf27655359'
AND (
token = 'Jqc1zEj+jJJN19upGPgNKtcPzSiI8y707LABm/lVyHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)