UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xrYONcs6t/S7Eu7V9mzHRuB0h9M9aw3hv2CTjROKsq4=' 
WHERE 
  key_id = '20cb0269f452b09eb76c4281fc5f60cf48119a3577546fddced3ee99c52f3d31' 
  AND (
    token = 'xrYONcs6t/S7Eu7V9mzHRuB0h9M9aw3hv2CTjROKsq4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019