UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LbNCA0JAWHmBWYIi7vM4nuumNG1fZkbNcKR4KxK0694='
WHERE
key_id = 'ebdaed029bdbf2b3be0b16c43dc031bff67fbfeaf5ddc744c76bf662dd36fbb7'
AND (
token = 'LbNCA0JAWHmBWYIi7vM4nuumNG1fZkbNcKR4KxK0694='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)