UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FFJ6n/PjGzO91FC4+dlSl5HKWcs/nXhv0Dedcpq2N3Y=' 
WHERE 
  key_id = '8c02c99c2145abc5f52b37119e06013f8f1d2c8af6c602260c2ce235616d9dfa' 
  AND (
    token = 'FFJ6n/PjGzO91FC4+dlSl5HKWcs/nXhv0Dedcpq2N3Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064