UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WGJdDvakZHBDwrEKZ6DydnuD4ngmexUrY4XG+O26Snw='
WHERE
key_id = '14763c0597786f367b805342c7cb78c39167f9e3f7d94b6fb1aba08b815af4b8'
AND (
token = 'WGJdDvakZHBDwrEKZ6DydnuD4ngmexUrY4XG+O26Snw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)