UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PrMW2ru6olE13ES5zC5ggGTTIZx/ji7/AVwdqy31EfQ=' 
WHERE 
  key_id = '1d150394c308fcf237c47ad3f85331f2e70339de5b00f830078d69e6c8c2dfa2' 
  AND (
    token = 'PrMW2ru6olE13ES5zC5ggGTTIZx/ji7/AVwdqy31EfQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027