UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hl2lH9cJHQSku0QD+3X0MydsG5nMErXw0UzScB9SRjo='
WHERE
key_id = 'fd14893eeb860488c62f89b254452ce684ed359fe6bf27caff9107263f9d4fc8'
AND (
token = 'hl2lH9cJHQSku0QD+3X0MydsG5nMErXw0UzScB9SRjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)