UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WI0G+4SmQFrbhafxj6yG4DY3TisZOpcaRqMEEsa1KcU=' 
WHERE 
  key_id = 'eda343206fae19832c593e69a6287e6c231894793789fe349321732591ed5ea7' 
  AND (
    token = 'WI0G+4SmQFrbhafxj6yG4DY3TisZOpcaRqMEEsa1KcU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017