UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8dX8oF2lMl4yRonAwimczSTcsry6b8x3NykGxRhmLRw='
WHERE
key_id = '6f6b02bd1a044d1dc9021c99e53496dc7cccff0109a314290f81ab4fb3063924'
AND (
token = '8dX8oF2lMl4yRonAwimczSTcsry6b8x3NykGxRhmLRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)