UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '332kcnELSFXrjj8K+UfbnFMrntZR+T+eyD7TM0D2vPI='
WHERE
key_id = '4446f5ba0bb1cda422d92b928c7a4a7a31703719cd0cefd9f47400d30cc8e397'
AND (
token = '332kcnELSFXrjj8K+UfbnFMrntZR+T+eyD7TM0D2vPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)