UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cb6XILxNGJzCtXQqAtnv6Lph357APNOPeYbxWAS9h1A=' 
WHERE 
  key_id = '7f2fa725bfe47c9a09cfec0b6c37ac31116622c2120b3ddf9391e07e90f0b447' 
  AND (
    token = 'Cb6XILxNGJzCtXQqAtnv6Lph357APNOPeYbxWAS9h1A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031