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