UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4RJA6WR1U9UczckZE7QyqfMXTwIglmLUDkBjIE/Q2tg='
WHERE
key_id = '6d881ae308e9f52ac3e66b6321a2d0239c1f0a5dfda6020fb30f1f46f7f88f25'
AND (
token = '4RJA6WR1U9UczckZE7QyqfMXTwIglmLUDkBjIE/Q2tg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)