UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qKMylzgAMPukrQMVLAemV71CywcMuisoiZ2Al642nrc=' 
WHERE 
  key_id = '96f72ac375debd2d3969e072569c058ca689a6c3a5ed135bbb7b98fce03bac94' 
  AND (
    token = 'qKMylzgAMPukrQMVLAemV71CywcMuisoiZ2Al642nrc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056