UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zrOcIegY3q29/AQBwtcp83pi9FH7JQFPdindv3nV2Fk='
WHERE
key_id = '37ff013c8e3cacd486c036c15d4878b7b8e2b2cd86523108a2d7ca048d6f4ed6'
AND (
token = 'zrOcIegY3q29/AQBwtcp83pi9FH7JQFPdindv3nV2Fk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)