UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/FFwuIcUTj4YHf/nVLHpW+vpjR8x2RaHplsAaIYibg0=' 
WHERE 
  key_id = '26f3477d80b4613e10209084a7ff0d809e54bfcdc3a294edd50f35a7782b7551' 
  AND (
    token = '/FFwuIcUTj4YHf/nVLHpW+vpjR8x2RaHplsAaIYibg0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052