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