UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rCOo0Wh3pm5Z0uLvssE5ubyKlSFg76E0cDIrk9Gz1TA=' 
WHERE 
  key_id = '25a54e309389b89ac7730b58a35073d59f32aa79099794523435088e861f9e90' 
  AND (
    token = 'rCOo0Wh3pm5Z0uLvssE5ubyKlSFg76E0cDIrk9Gz1TA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039