UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QKR8MXOW+pt77uQLa3JD91wc8u/Kur7k3d32m6zqUQI='
WHERE
key_id = 'a546ae22abbccad5314ebcc3356850ea98205a21c930e0cd2fb14901dbc0c372'
AND (
token = 'QKR8MXOW+pt77uQLa3JD91wc8u/Kur7k3d32m6zqUQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)