UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wK6UNVbH4fBMJVnmGbDswTKyCWPeOI0PJCWKexFGxXE='
WHERE
key_id = '5c3563c95e94be884c6ccbd36fa9c2d653ce5bfa7c69dcb1e5e695f0654fcb3b'
AND (
token = 'wK6UNVbH4fBMJVnmGbDswTKyCWPeOI0PJCWKexFGxXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)