UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9cj2QKKqNeOcK6uLFYeJa0WIFLLlJ47zu+rvt3nEzBc='
WHERE
key_id = '87fa27b1f03927e6cc4e4e68eeb7702c41b1715a56c9b2b9d2266c27a07a5519'
AND (
token = '9cj2QKKqNeOcK6uLFYeJa0WIFLLlJ47zu+rvt3nEzBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)