UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IUTHMWhJwQlkKWEHU4V4DDjeMfCLzzpy3oC+UgnTNac=' 
WHERE 
  key_id = '40484ef1ee63275e7e347490a3f01ef1874f930f0bb18db60e7a5a158313d1c3' 
  AND (
    token = 'IUTHMWhJwQlkKWEHU4V4DDjeMfCLzzpy3oC+UgnTNac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020