UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p/l5WHdCALDxnLESjpTUuN93AeO4rNubCjKkF5Mlsjg=' 
WHERE 
  key_id = 'b447e9ecf9b26205c12d73fd5109fcbbca9da639ba5ad85f3b2a945a434d09d7' 
  AND (
    token = 'p/l5WHdCALDxnLESjpTUuN93AeO4rNubCjKkF5Mlsjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033