UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xn1fIoU1HhZeECd79KoxZNVhYX1bU6QfifihRJJk0ys='
WHERE
key_id = '335558d86a2b3f298af3f36f4dabe6424beeda855a3230f8c35dd384fcc6b22c'
AND (
token = 'xn1fIoU1HhZeECd79KoxZNVhYX1bU6QfifihRJJk0ys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)