UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2FZe5FSXMcLLAQFDa4e2A+aeoKHwc6UX7EDdD7FUu1o='
WHERE
key_id = '974b5c81ebfa0923f74a2bee742c728c80c83f18723b810834d1a404dcdf0d1f'
AND (
token = '2FZe5FSXMcLLAQFDa4e2A+aeoKHwc6UX7EDdD7FUu1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)