UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3L04gkn1iHxpdBowD62Io1hz9lI9sb+YngPSCzJDw6U='
WHERE
key_id = 'a32e85faca9736e1dbe0b84cb0ca6f886b25b112b3013d9e22fd526cc088d89a'
AND (
token = '3L04gkn1iHxpdBowD62Io1hz9lI9sb+YngPSCzJDw6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)