UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nl/57hTIexOzYpMw00rKiyV/cMjdAFckWW5aSDkG0RQ='
WHERE
key_id = '1d42b6cfb5e09b7e367a8d528eb7fcdc78db2b2ae23f9eef7023c403fe8d98f9'
AND (
token = 'Nl/57hTIexOzYpMw00rKiyV/cMjdAFckWW5aSDkG0RQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)