UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CCgLsSV3FeR97bwx3LOnRR9PFS7KG3y4RfeaqRXSMNg=' 
WHERE 
  key_id = '559596b0b088c6ae3d8d2c832de4fb2a7167220372ad21d6c3545657f95f0356' 
  AND (
    token = 'CCgLsSV3FeR97bwx3LOnRR9PFS7KG3y4RfeaqRXSMNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055