UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yOw8Exk/Q5d7/JiOSgvEO36Qpe4y2dpRktq7H1SjqVY='
WHERE
key_id = '2686168e5697162d980ab86532fc77c36f7e251eb37068164d2d0b63ed5338a4'
AND (
token = 'yOw8Exk/Q5d7/JiOSgvEO36Qpe4y2dpRktq7H1SjqVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)