UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k4U5PCREWl5zcmtJfkSYtp0aQmztX+oEw0WmgvcmbDg=' 
WHERE 
  key_id = 'f45d9a4cdd4162e4f0741d41b328e539ab67176fd56c155bee684f3e86bd9bd3' 
  AND (
    token = 'k4U5PCREWl5zcmtJfkSYtp0aQmztX+oEw0WmgvcmbDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028