UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5q18Q5vNdjasGEsqXYab38xeJrrAsguzjT92SaxsTX8='
WHERE
key_id = '61943130eb267984cf15e9116e702105509d6df4d612e954acbadd9cd437c208'
AND (
token = '5q18Q5vNdjasGEsqXYab38xeJrrAsguzjT92SaxsTX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)