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

Query time 0.00033