UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wp//ieVaFUFRz3Rb1Xdzp0L+OXHl6xnpqpwm+ICqykM='
WHERE
key_id = '7b6aa4f80477e0bd3c3f6afa6afac2f69af919ebeb24f56527c2ed6dcd4c3163'
AND (
token = 'wp//ieVaFUFRz3Rb1Xdzp0L+OXHl6xnpqpwm+ICqykM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)