UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sKhAfQzYJUGEn+1xD2se7kVKhThphT1I5wr24vNxV2U='
WHERE
key_id = '598efc53640eebd1015d785b15e631209cd663f836582db8b01518f02375b578'
AND (
token = 'sKhAfQzYJUGEn+1xD2se7kVKhThphT1I5wr24vNxV2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)