UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+swvs8XNCsXH9+vwcVB4R74/EDhwMN8AJnmWPY3ymOs='
WHERE
key_id = '07b7b21724ccf1c38da36ce6908bbf908415503c486dc41a5efefc8ef37932e1'
AND (
token = '+swvs8XNCsXH9+vwcVB4R74/EDhwMN8AJnmWPY3ymOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)